import requests
from bs4 import BeautifulSoup

url = 'https://www.4399.com'

# 发送 GET 请求获取网页内容
response = requests.get(url)

# 解析网页内容
soup = BeautifulSoup(response.text, 'html.parser')

# 示例：获取首页的标题
title = soup.title.text
print('网页标题:', title)

# 示例：获取首页的所有链接
links = soup.find_all('a')
for link in links:
    href = link.get('href')
    if href:
        print('链接:', href)
